Skip to content

Conversation

Copy link

Copilot AI commented Nov 30, 2025

Port of the ZON (Zero Overhead Notation) format from zon-ts to Java. ZON achieves 23.8% token reduction vs JSON while maintaining 100% LLM retrieval accuracy.

Core Implementation

  • Zon - Static encode()/decode() API
  • ZonEncoder - Table encoding for uniform arrays, T/F booleans, canonical number formatting
  • ZonDecoder - Strict/non-strict modes, dotted key expansion, CSV+JSON escape handling
  • ZonDecodeError - Error codes E001-E304 with line/context info
  • Cli - Command-line encode/decode for JSON↔ZON conversion

Test Suite (92 tests)

  • Round-trip codec tests
  • Conformance tests (encoder/decoder spec compliance)
  • Strict mode validation (row/field count mismatches)
  • Security tests (prototype pollution, DOS limits, circular refs)

Documentation

  • README, SPEC.md, API reference, syntax cheatsheet, LLM best practices
  • Benchmark reports copied from zon-ts

Usage

// Encode
Map<String, Object> data = Map.of("name", "Alice", "active", true);
String zon = Zon.encode(data);
// active:T
// name:Alice

// Decode (strict mode default)
Object decoded = Zon.decode(zon);

// Decode (non-strict)
Object decoded = Zon.decode(zon, false);

MIT License - Roni Bhakta

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com//advisories
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

https://github.com/ZON-Format/zon-ts
Based on this package, I’ve provided you with the logic and motivation of the encoder, decoder, and CLI. Please produce the same tests for the java package. Additionally, ensure it’s MIT-licensed with my name, which is mentioned in the provided repo
Make sure that the accuracy is the same as per the java language. Also, produce all the documentation as per the guidelines provided. You can copy the benchmark reports from the above package into the java package


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 30, 2025
Copilot AI and others added 2 commits November 30, 2025 14:55
…umentation

Co-authored-by: ronibhakta1 <77425964+ronibhakta1@users.noreply.github.com>
Co-authored-by: ronibhakta1 <77425964+ronibhakta1@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests and documentation for Java package Add ZON Java implementation with tests and documentation Nov 30, 2025
Copilot AI requested a review from ronibhakta1 November 30, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants